<?php
$title = "Quiz Results";
echo "<title>$title</title>";
// Below gets the answers from the page before //
if (isset ($_POST['submit'])) {
   $name = $_POST['name'];
   $q1 = $_POST['q1'];
   $q2 = $_POST['q2'];
   $q3 = $_POST['q3'];
   $q4 = $_POST['q4'];
   $q5 = $_POST['q5'];
   $qp = $_POST['qp'];
}
// Below checks to see if you forgot anything //
if ($name == "") {
   die ("You forgot something, go back and check over your quiz.");
}
if ($q1 == "") {
   die ("You forgot something, go back and check over your quiz.");
}
if ($q2 == "") {
   die ("You forgot something, go back and check over your quiz.");
}
if ($q3 == "") {
   die ("You forgot something, go back and check over your quiz.");
}
if ($q4 == "") {
   die ("You forgot something, go back and check over your quiz.");
}
if ($q5 == "") {
   die ("You forgot something, go back and check over your quiz.");
}
// Below is where the answers are actually displayed //
{
        echo<<<EOT
<p>Results: $name<br>
1.) $q1<br>
2.) $q2<br>
3.) $q3<br>
4.) $q4<br>
5.) $q5</p>
<p><a href="$qp">Go Back To Quiz?</a>

EOT;
}
?>